//
//  UITextField+placeholderColor.m
//  BaiSiProject
//
//  Created by lshenrong on 16/7/9.
//  Copyright © 2016年 lshenrong. All rights reserved.
//

#import "UITextField+placeholderColor.h"

@implementation UITextField(placeholderColor)

-(void)setPlaceholderColor:(UIColor *)placeholderColor
{
//   //方法1
//       NSMutableDictionary *attDict=[NSMutableDictionary dictionary];
//    attDict[NSForegroundColorAttributeName]=placeholderColor;
//        //是self.placeholder不是self.text
//      NSAttributedString *attrString=[[NSAttributedString alloc] initWithString:self.placeholder attributes:attDict];
//        self.attributedPlaceholder=attrString;
   

//方法2
    UILabel *placeholderLabel=[self valueForKey:@"placeholderLabel"];
    placeholderLabel.textColor=placeholderColor;

}

@end
